package com.ithema.service.impl;

import com.ithema.dao.OrderDao;
import com.ithema.domain.Order;
import com.ithema.service.OrderService;
import com.ithema.util.JsonConverter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description
 * @Author wangyu
 * @Date 2021/10/31
 */
@Slf4j
@Service
public class OrderServiceImpl implements OrderService, JsonConverter {

    @Autowired
    private OrderDao orderDao;

    @Override
    public Order findByOid(Integer oid) {
        return orderDao.findById(oid).get();
    }

    @Override
    public Order createOrder(Order order) {
        return orderDao.save(order);
    }
}
